home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / magazi~1 / 226 / analog.49 / f9.c < prev    next >
Encoding:
Text File  |  1986-10-14  |  1.0 KB  |  45 lines

  1. /*****************************************************************
  2. *
  3. * f9.c-- miscellaneous c routines.
  4. *
  5. *    [24.VII.86:    started.]
  6. *
  7. *
  8. *****************************************************************/
  9.  
  10. /*****
  11. *
  12. * psend-- send a string to the printer.
  13. *
  14. *****/
  15. int psend(s)
  16. char *s;       /* string to send   */
  17. {
  18.      long time;               /* timeout count         */
  19.      int go = TRUE;           /* continuation cond     */
  20.  
  21.      while (go)
  22.      {
  23.           /* wait for printer ready     */
  24.           for (time = 0; time < TIME_OUT && !Cprnos(); time++)
  25.                ;
  26.           go = (time == TIME_OUT) ? FALSE : TRUE;
  27.           /* print next char or linefeed at end of string   */
  28.           if (go)
  29.           {
  30.                if (*s)
  31.                     Cprnout((int)*s++);
  32.                else
  33.                {
  34.                     Cprnout(0xa);
  35.                     return TRUE;   /* success     */
  36.                }
  37.           }
  38.      }
  39.      return FALSE;     /* timeout error      */
  40. }
  41.  
  42.  
  43.  
  44.               
  45.